/**
 * @(#)UserClientInfo2DAOImpl.java 2017年5月3日
 * Copyright(C) 2017 ZHEXIN IT CO.,LTD. All rights reserved.
 */
package org.jsbd.boss.dao.impl;

import java.util.List;

import org.jsbd.boss.dao.IUserClientInfoLogDAO;
import org.jsbd.boss.domian.channel.QueryUserClientVo;
import org.jsbd.boss.domian.channel.UserClientInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import edu.hziee.common.queue.IBatchExecutor;

/**
 * 客户端信息
 * 
 * @author <a href="mailto:xupengcheng@zhexinit.com" >徐鹏程</a>
 * @version 1.0.0
 */
@Service("userClientLogDao2")
public class UserClientInfoLogDAOImpl2 extends CrackLogBaseDao2 implements IUserClientInfoLogDAO, IBatchExecutor<UserClientInfo> {
	public static final Logger LOGGER = LoggerFactory.getLogger(UserClientInfoLogDAOImpl2.class);

	/*
	 * (non-Javadoc)
	 * 
	 * @see edu.hziee.common.queue.IBatchExecutor#execute(java.util.List)
	 */
	@Override
	public void execute(List<UserClientInfo> records) {
		super.batchInsert("qy_client_info_log.INSERT_USER_CLIENT", records);
	}

	@Override
	public UserClientInfo selectClientInfo(QueryUserClientVo userVo) {
		List<UserClientInfo> list = super.queryForList("qy_client_info_log.SELECT_CLIENT_INFO", userVo);
		if (list != null && list.size() > 0) {
			return list.get(0);
		}
		return null;
	}

	@Override
	public int deleteClientInfo(String imsi, String mark, String rd) {
		QueryUserClientVo queryVo = new QueryUserClientVo();
		queryVo.setImsi(imsi);
		queryVo.setMark(mark);
		queryVo.setRd(rd);
		return super.delete("qy_client_info_log.DELETE_CLIENT_INFO", queryVo);
	}


}
